/*
package com.cskaoyan.rocket;

import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.springframework.stereotype.Component;



@Component
public class Produce {

    public class Producer {
        private String producerGroup = "order_producer";
        private DefaultMQProducer producer;
        //构造
        public Producer(){
            //创建生产者
            producer = new DefaultMQProducer(producerGroup);
            //不开启vip通道
            producer.setVipChannelEnabled(false);
            //设定 name server
            producer.setNamesrvAddr("127.0.0.1:9876");
            //producer.m
            start();
        }

        //使producer启动
        public void start(){
            try {
                this.producer.start();
            } catch (MQClientException e) {
                e.printStackTrace();
            }
        }
        //返回producer
        public DefaultMQProducer getProducer(){
            return this.producer;
        }

        //进行关闭的方法
        public void shutdown(){
            this.producer.shutdown();
        }
    }
}
*/
